package com.dream.keigezhushou.Activity.acty.personal;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.dream.keigezhushou.Activity.activity.BaseActivity;
import com.dream.keigezhushou.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class RechargeStyleActivity extends BaseActivity implements View.OnClickListener{

    @BindView(R.id.iv_return)
    ImageView ivReturn;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.iv_wei_pay)
    ImageView ivWeiPay;
    @BindView(R.id.rl_wei_pay)
    RelativeLayout rlWeiPay;
    @BindView(R.id.iv_alipay)
    ImageView ivAlipay;
    @BindView(R.id.rl_alipay)
    RelativeLayout rlAlipay;
    @BindView(R.id.btn_recharge)
    Button btnRecharge;

    private Intent intent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recharge_style);
        ButterKnife.bind(this);

        initView();
        initData();
    }

    //初始化界面
    protected void initView(){

        tvTitle.setText("支付订单");

        //初始化默认选择微信支付
        ivWeiPay.setSelected(true);
        ivAlipay.setSelected(false);

    }

    //初始化数据
    protected void initData(){

        ivReturn.setOnClickListener(this);
        ivWeiPay.setOnClickListener(this);
        ivAlipay.setOnClickListener(this);
        rlWeiPay.setOnClickListener(this);
        rlAlipay.setOnClickListener(this);
        btnRecharge.setOnClickListener(this);
    }

    //点击事件的实现

    @Override
    public void onClick(View view) {


        switch (view.getId()){

            case R.id.iv_return:

                //返回
                finish();
                break;

            case R.id.iv_wei_pay:

                ivWeiPay.setSelected(true);
                ivAlipay.setSelected(false);
                break;

            case R.id.iv_alipay:

                ivWeiPay.setSelected(false);
                ivAlipay.setSelected(true);
                break;

            case R.id.rl_wei_pay:

                ivWeiPay.setSelected(true);
                ivAlipay.setSelected(false);
                break;

            case R.id.rl_alipay:

                ivWeiPay.setSelected(false);
                ivAlipay.setSelected(true);

                break;

            case R.id.btn_recharge:

                intent = new Intent(this, RechargeSuccessActivity.class);
                startActivity(intent);

                break;

        }
    }
}
